package com.example.weight.navigation;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import com.example.weight.R;
import com.example.weight.greenSeasons.deodorization.D4Activity;
import com.example.weight.greenSeasons.deodorization.DuifeiDeodorization;
import com.example.weight.greenSeasons.deodorization.DuifeiDeodorization_old;
import com.example.weight.greenSeasons.deodorization.SolidLiquidDeodorization;
import com.example.weight.greenSeasons.deodorization.SolidLiquidDeodorization_old;
import com.hjq.bar.OnTitleBarListener;
import com.hjq.bar.TitleBar;
import android.net.Uri;

public class SijiqingDeodorizationNavActivity extends AppCompatActivity {
    private String name, factory;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sijiqing_deodorization_nav);

        Intent previousIntent = getIntent();
        name = previousIntent.getStringExtra("name");
        factory = previousIntent.getStringExtra("factory");

        TitleBar titleBar = findViewById(R.id.sijiqing_deodorization_nav_titleBar);
        titleBar.setOnTitleBarListener(new OnTitleBarListener() {
            @Override
            public void onLeftClick(View v) {
                finish();
            }

            @Override
            public void onTitleClick(View v) {}

            @Override
            public void onRightClick(View v) {}
        });
    }
    public void turnSolidLiquidDeodorization(View view) {
        Intent intent =new Intent(SijiqingDeodorizationNavActivity.this, SolidLiquidDeodorization_old.class);
        intent.putExtra("name", name);
        intent.putExtra("factory", factory);
        startActivity(intent);
    }
    public void turnDuifeiDeodorization(View view) {
        Intent intent =new Intent(SijiqingDeodorizationNavActivity.this, DuifeiDeodorization_old.class);
        intent.putExtra("name", name);
        intent.putExtra("factory", factory);
        startActivity(intent);
    }

    public void turnD4Activity(View view) {
        Intent intent =new Intent(SijiqingDeodorizationNavActivity.this, D4Activity.class);
        intent.putExtra("name", name);
        intent.putExtra("factory", factory);
        startActivity(intent);
    }

    public void turnBrowser(View view){
        Uri uri = Uri.parse("http://39.105.29.195/#/login");
        Intent intent = new Intent(Intent.ACTION_VIEW, uri);
        startActivity(intent);
    }
}
